//
//  FingerEffect.cpp
//  Clicker Heroes
//
//  Created by Cloner Team on 11/11/14.
//
//

#include "FingerEffect.h"
FingerEffect::FingerEffect() {
    
}

FingerEffect::~FingerEffect() {
    
}

bool FingerEffect::init() {
    Face* mainFace  = new Face();
    mainFace->setName((char*)FACE_MAIN);
    mainFace->initWithSpriteFrameName(ANI_EFFECT0);
    //state level 0
    Action* effect0Action = mainFace->createState((char*)ANI_EFFECT_FRAME0, 0, 5, 0.3, false, false);
    mainFace->registerState((char*)STATE_EFFECT0, effect0Action);
    //state level 1
    Action* effect1Action = mainFace->createState((char*)ANI_EFFECT_FRAME1, 0, 4, 0.3, false, false);
    mainFace->registerState((char*)STATE_EFFECT1, effect1Action);
    //state level 2
    Action* effect2Action = mainFace->createState((char*)ANI_EFFECT_FRAME2, 0, 5, 0.3, false, false);
    mainFace->registerState((char*)STATE_EFFECT2, effect2Action);
    //state level 3
    Action* effect3Action = mainFace->createState((char*)ANI_EFFECT_FRAME3, 0, 5, 0.3, false, false);
    mainFace->registerState((char*)STATE_EFFECT3, effect3Action);
    //state level 4
    Action* effect4Action = mainFace->createState((char*)ANI_EFFECT_FRAME4, 0, 6, 0.3, false, false);
    mainFace->registerState((char*)STATE_EFFECT4, effect4Action);
    //state level 5
    Action* effect5Action = mainFace->createState((char*)ANI_EFFECT_FRAME5, 0, 7, 0.3, false, false);
    mainFace->registerState((char*)STATE_EFFECT5, effect5Action);
    
    RectBody* body = new RectBody(mainFace->getContentSize().width, mainFace->getContentSize().height);
    CC_SAFE_RETAIN(body);
    this->body = body;
    
    this->faces->addObject(mainFace);
    return true;
}